﻿$(function () {
    $.kish = {};
    $.kish.AccountAdmin = {};

    $.extend($.kish.AccountAdmin, {
        doLogOut: function (code) {
            $.kish.AccountAdmin.doLogOut(code, 0);
        },

        doLogOut: function () {
            $.ajax({
                url: '../Services/Logout.svc/goLogin',
                data: '',
                dataType: "json",
                type: "POST",
                contentType: "application/json; charset=utf-8",
                success: function (result) {
                    if (!result['d'].IsSucceed) {
                        $.kish.message.getUserMessage(result['d'].Message.Code);
                    }
                    else {
                        window.location.replace("../Account/Login.aspx")
                    }
                }
            });

        }
    });

    $(".fn_logOut").click(function () {
        $.kish.AccountAdmin.doLogOut();
    });

    $('.AdminMenu_fn').hover(function () {
        $(this).find('ul li.noDisplay').show()
    },
    function () { $(this).find('ul li.noDisplay').hide() }
    );
});

